﻿using Microsoft.AspNetCore.Mvc;
using Tpl.Domain.Entities;
using Tpl.Domain.Repository;
using Tpl.Ef.Pe;

namespace Tpl.WebApi.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class LibraryController : ControllerBase
    {
        private ILogger<LibraryController> _logger;
        //private IAsyncRepository<User, long> _userRep;
        private LibraryDbContext _libDb;
        public LibraryController(ILogger<LibraryController> logger, LibraryDbContext libDb) 
        { 
            this._logger=logger;
          //  this._userRep=userRep;
          this._libDb=libDb;
        }

        [HttpGet]
        public IEnumerable<User> GetUser()
        {
            return _libDb.Set<User>().ToList();
        }
    }
}
